package com.example.springmvc;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class HelloWorldController {

    @RequestMapping("/hello")
    public String hello(Model model, @RequestParam(value = "name", defaultValue = "Guest") String name) {
        model.addAttribute("greeting", "Hello, " + name);
        return "helloworld";

    }

}